<template>
    <div class="page-bridal-images">
        <div class="inner">
            <wx-swiper
                class="swipper white-bg"
                autoplay="true"
                interval="3000"
                duration="1000"
                circular="true">
                <wx-swiper-item class="swipper-item" @click="onClickBanner" v-for="(item, index) in comment.image" :key="index">
                    <img :src="item" mode="widthFix" />
                </wx-swiper-item>
            </wx-swiper>
            <div class="content-box text-normal white-color">
                <div class="info-box">
                    <div class="avatar">
                        <img :src="comment.avatar" mode="aspectFill" />
                    </div>
                    <div class="name">{{comment.nickname}}</div>
                </div>
                <div class="content">
                    {{comment.content}}
                </div>
            </div>
        </div>
    </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component({
    name: 'BridalImages',
})
export default class BridalImages extends Vue {
    public get comment() {
        return JSON.parse(decodeURIComponent(this.$route.query.comment as string));
    }

    async created() {
        if (!this.$route.query.comment) {
            wx.navigateBack();
            return;
        }
    }
}
</script>
<style lang="less">

@import "../../lib/style/mixins.less";

.page-bridal-images {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: @black-color;
    .inner {
        flex: 1;
        background: @black-color;
        .swipper {
            position: relative;
            width: 100%;
            height: 100%;
            background: @black-color;
            .swipper-item {
                overflow-y: scroll;
            }
            image {
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
            }
        }
        .content-box {
            position: fixed;
            left: 0;
            bottom: 0;
            width: 100%;
            padding: 40rpx;
            box-sizing: border-box;
            background-color: rgba(0, 0, 0, 0.24);
            .info-box {
                display: flex;
                align-items: center;
                margin-bottom: 10px;
                .avatar {
                    width: 34px;
                    height: 34px;
                    margin-right: 30rpx;
                    image {
                        width: 100%;
                        height: 100%;
                        border-radius: 50%;
                    }
                }
            }
        }
    }
}

</style>
